import { createApp } from 'vue'
import App from '@/App.vue'
//引入element-plus
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
//svg插件
import 'virtual:svg-icons-register'
//暗黑模式引入
import 'element-plus/theme-chalk/dark/css-vars.css'

//引入仓库
import pinia from './store'
//引入自定义插件对象:组测整个项目全局组件
import gloalComponent from '@/components'

//引入模板的全局样式
import '@/styles/index.scss'

//配置element-plus国际化
//@ts-ignore
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
//引入路由
import router from './router'

import './permisstion'
//获取应用实例对象
const app = createApp(App)
createApp(App).mount('#app')
//安装element-plus插件
app.use(ElementPlus, {
  locale: zhCn, //element-plus国际化配置
})
//引入自定义指令
import { isHasButton } from './directive/has'
isHasButton(app)

//安装自定义插件
app.use(gloalComponent)

//安装仓库
app.use(pinia)

//注册路由
app.use(router)
//将应用挂载到挂载点上
app.mount('#app')
